import { AnalysisTools, AnalysisType } from '@/utils/analysis/AnalysisTools';
//导入接口类，并使用其实现类Tooltip
import { Tooltip } from '@/utils/tooltips/impl/Tooltip';

let tools: AnalysisTools;

export function useAnalysis(viewer: any) {
  if (!tools) {
    tools = new AnalysisTools({
      viewer,
      tooltip: new Tooltip(),
    });
  }

  return {
    activateAnalysis: (type: AnalysisType) => tools.activate(type),
    clearAllAnalysis: () => tools.clearAll(),
  };
}
